//
//  FreshHotCell.m
//  爱鲜蜂
//
//  Created by 廖易诚 on 16/8/31.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "FreshHotCell.h"
#import "UIImageView+WebCache.h"
#import "HotSaleModel.h"

@interface FreshHotCell ()

@property (nonatomic, weak) UIImageView *imageView;

@end

@implementation FreshHotCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UIImageView *imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:imageView];
        self.imageView = imageView;
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageView.x = 0;
    self.imageView.y = 0;
    self.imageView.w = self.w;
    self.imageView.h = self.h;
}

- (void)setModel:(HotSaleModel *)model {
    _model = model;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"icon_icons_holder"]];
}

@end
